import request from '../utils/request'

const res = {
   getUser(params){
     return request({
        url:`/user`,
        method:'GET',
        headers:{
            'Authentication':localStorage.token
        },
        params:{
         ...params,
         pageSize:10,
        }
     })
   },
   //修改
   upDateUser(params){
      return request({
         url:`/user`,
         method:'put',
         headers:{
             'Authentication':localStorage.token
         },
       params
      })
    },
    //新增
    addUser(params){
      return request({
         url:`/user`,
         method:'post',
         headers:{
            'Content-Type': 'application/x-www-form-urlencoded',
             'Authentication':localStorage.token
         },
       data:params
      })
    },
    //删除
    delUser(userId){
      return request({
         url:`/user/${userId}`,
         method:'delete',
         headers:{
             'Authentication':localStorage.token
         },
      })
    }
}

export default res